home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / LIBRARY / TPWENG / GETLONG.PAS < prev    next >
Pascal/Delphi Source File  |  1991-07-22  |  838b  |  34 lines

  1. program GetLong;
  2. uses PXEngine, WinCrt;
  3.  
  4. const TableName = 'Table';
  5.  
  6. var   PxErr: Integer;
  7.       TblHandle: TableHandle;
  8.       RecHandle: RecordHandle;
  9.       FldHandle: FieldHandle;
  10.       LValue: LongInt;
  11.  
  12. procedure PX(Code : integer);
  13. begin
  14.   writeln(PXErrMsg(Code));
  15. end;
  16.  
  17. begin
  18.   PX(PXWinInit('MyApp', pxShared));
  19.   PX(PXTblOpen(TableName, TblHandle, 0, False));
  20.   PX(PXRecBufOpen(TblHandle, RecHandle));
  21.   PX(PXRecGet(TblHandle, RecHandle));
  22.   PX(PXFldHandle(TblHandle, 'Numeric Field', FldHandle));
  23.  
  24.   (* Get a double value from a record *)
  25.   PxErr := PXGetLong(RecHandle, FldHandle, LValue);
  26.   if PxErr <> PxSuccess then
  27.     Writeln(PxErrMsg(PxErr))
  28.   else Writeln('Field number ', FldHandle, ' contents: ', LValue);
  29.  
  30.   PX(PXRecBufClose(RecHandle));
  31.   PX(PXTblClose(TblHandle));
  32.   PX(PXExit);
  33. end.
  34.